setFocusedByDefault

open fun setFocusedByDefault(@NonNull view: View, isFocusedByDefault: Boolean)(source)

Sets whether view should receive focus when the focus is restored for the view hierarchy containing it.

Focus gets restored for a view hierarchy when the root of the hierarchy gets added to a window or serves as a target of cluster navigation.

Does nothing on API <26.

Parameters

view

view for which to set the state.

isFocusedByDefault

true to set view as the default-focus view, false otherwise.